package com.njworkorder.HTSingleLogin;

import cn.microvideo.qsc.client.api.QsApi;
import cn.microvideo.qsc.client.entity.ModuleInfo;
import cn.microvideo.qsc.client.entity.OrganizationInfo;
import cn.microvideo.qsc.client.entity.Result;
import cn.microvideo.qsc.client.entity.Role;
import cn.microvideo.qsc.client.entity.User;
import cn.microvideo.qsc.client.entity.xml.ParentOrganizations;
import cn.microvideo.qsc.client.entity.xml.ParentRole;
import cn.microvideo.qsc.client.entity.xml.ParentRoles;
import cn.microvideo.qsc.client.entity.xml.ParentUsers;


import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class QsClient {


    //http://139.198.168.206:8888/Qsecurity/main/index.zul?one=YWRtaW4=

    //开发测试环境，可以公网访问
    //final static String path = "http://139.198.168.206:8888/Qsecurity/";

    //养护技术公司生产环境,只能内网访问
    //final static String path = "http://172.26.0.4:9092/Qsecurity/";

    //final static String path = "https://cas.jsjkyh.com:7088/Qsecurity/";

    //final static String path = "https:/139.198.176.196:7088/Qsecurity/";


    final static String path = "https://qianhe-uzising.lingyunzhineng.com/Qsecurity/";

    //final static String path = "http://192.168.26.204:38080/Qsecurity/";

    final static String qsSecret ="MicroVideo2022";


    //地址配置，全局只需配置一次即可。
    public static void init(){

      // QsApi.getApi().init(path);
        System.out.println("path="+path);
        System.out.println("qsSecret="+qsSecret);
        //QsApi.getApi().init(path);
        QsApi.getApi().initForToken(path);
//        QsApi.getApi().init(path,qsSecret);
    }

    public static void main(String[] args) {

//        init();
//        QsApi.getApi().getOrganizationAll();
//
//        User user1 = QsApi.getApi().getPersonByPid("15951992689");
//        System.out.println(user1);

        QsApi.getApi().initForToken("https://jhgs.stb.js.cn/Qsecurity/");
        ParentRoles roleByUid = QsApi.getApi().findRoleByUid("18083770499");
        System.out.println(roleByUid.getRoles().getRoleList().get(0).getName());

    }




}
